package com.wtf.generator.enums;

import com.fasterxml.jackson.annotation.JsonValue;

/**
 * date: 2022/6/18 10:59
 * @author linhuanyou
 * @email 496558736@qq.com
 * @version 1.0
 */
public enum CommonErrorEnum {
    SUCCESS(0,"操作成功"),

    ERROR_THIRD_PLATFORM_NOT_EXIST(401,"认证平台不存在"),
    ERROR_STATE(401,"状态码错误"),
    PERMISSION_DENIED(403,"权限不足"),


    SYSTEM_BUSY(500001, "系统繁忙，请稍候再试"),
    OPERATION_ERRO(500002,"操作失败"),
    ERROR_NULL(500003,"空指针错误!"),
    ERROR_VALID(500004,"参数错误!"),
    ERROR_REQUEST_METHOD_NOT_SUPPORTED(500005,"请求方式错误!"),
    ERROR_NETWORK(500006,"网络异常!"),
    ERROR_EXCEL(500007,"Excel解析错误"),
    ERROR_INVAILD_CHAR(500008,"非法字符"),
    ERROR_DUPLICATE_KEY(500009,"数据重复"),
    ERROR_BAS_REQUEST(500010,"非法请求"),
    ERROR_XML_PARSE(500011,"XML解析异常"),
    ERROR_PAGE_SELECT_SQL(500012,"分页查询必须是SELECT查询语句"),
    ERROR_DBTYPE(500013,"数据库类型不存在"),
    ERROR_DB(500014,"数据库操作异常"),
    ERROR_NOT_FIND_DS(500015,"数据源不存在"),
    ERROR_PRIMARY_DS(500016,"主数据源无法操作"),
    OPEN_CONNECTION_EXCEPTION(500017,"连接失败，请检查主机、账号、密码、数据库是否正确"),
    CLOSE_CONNECTION_EXCEPTION(500018,"数据库连接关闭异常"),


    ;
    @JsonValue
    private int errCode;

    private String errMsg;

    CommonErrorEnum(int errCode, String errMsg) {
        this.errCode = errCode;
        this.errMsg = errMsg;
    }

    public int getErrCode() {
        return errCode;
    }

    public void setErrCode(int errCode) {
        this.errCode = errCode;
    }

    public String getErrMsg() {
        return errMsg;
    }

    public void setErrMsg(String errMsg) {
        this.errMsg = errMsg;
    }
}
